/**
 * Title: jFamilyTree XSLT provider
 * Description: jFamilyTree provider using XSL-transformed file
 * Version: provider
 * Copyright: (c) 2001-2008
 * Terms of use:see license agreement at http://treebolic.sourceforge.net/en/license.htm
 * Author: Bernard Bou
 * Company: bsys
 */
package bsys.xml.transformer;

/**
 * @author Bernard Bou
 */
public class Main
{
	public static void main(String[] theseArgs)
	{
		try
		{
			String thisSourceFilePath = theseArgs[0];
			String thisResultFilePath = theseArgs[1];
			String thisXsltFilePath = theseArgs[2];
			boolean outputHtml = false;
			if (theseArgs.length > 3)
			{
				String thisFlag = theseArgs[3];
				outputHtml = thisFlag.equalsIgnoreCase("html");
			}
			String thisDtd = null;
			if (theseArgs.length > 4)
				thisDtd = theseArgs[4];

			new DomTransformer(outputHtml, thisDtd).fileToFile(thisSourceFilePath, thisResultFilePath, thisXsltFilePath);
		}
		catch (Throwable e)
		{
			System.err.println("Usage: <source file><result file><xslt file><html|xml|text><dtd>");
			e.printStackTrace();
		}
	}
}
